<template>
<div class="qf-good-item" @click='skipToDetail'>
  <img :src='$api.baseImg+good.img' alt="">
  <div class="info">
    <span v-if='good.self'>[京]</span>
    <span v-text='good.name'></span>
  </div>
  <div class="bottom">
    <span></span>
    <span>{{good.price | handPrice}}</span>
    <span v-if='isSimilar'>看相似</span>
  </div>
</div>
</template>

<script>
export default {
  props: {
    good: { type: Object, required: true },
    isSimilar: { type: Boolean, required: false, default: false }
  },
  methods: {
    skipToDetail() {
      this.$router.push('/good/detail/'+this.good._id)
    }
  }
}
</script>

<style lang="scss" scoped>
.qf-good-item {
  width: 17.5rem;
  height: 27.5rem;
  border: 2rem;
  overflow: hidden;
  >img {
    width: 17.3rem;
    height: 17.3rem;
  }
  .info {
    font-size: 1.3rem;
    line-height: 2.6rem;
    color: #1a1a1a;
  }
}
</style>
